function draw() {
    var myChart = echarts.init(document.getElementById('firstPage-graph1'));

    // 指定图表的配置项和数据
    option = {
        // legend: {
        //     top: 'bottom'
        // },
        title: {
            text: '2020上半年杭州夜间打车目的地类型占比',
            subtext: '数据来源：曹操出行',
            left: 'center'
        },
        // toolbox: {
        //     show: true,
        //     feature: {
        //         mark: {show: true},
        //         dataView: {show: true, readOnly: false},
        //         restore: {show: true},
        //         saveAsImage: {show: true}
        //     }
        // },
        series: [
            {
                name: '面积模式',
                type: 'pie',
                radius: [20, 80],
                // center: ['25%', '25%'],
                roseType: 'area',
                itemStyle: {
                    borderRadius: 5
                },
                data: [
                    {value: 0.4146, name: '商圈:41.46%'},
                    {value: 0.27, name: '美食街:27%'},
                    {value: 0.2254, name: '产业园区:22.54%'},
                    {value: 0.0874, name: '旅游景点:8.74%'},
                    {value: 0.026, name: '娱乐场所:0.26%'}
                ]
            }
        ]
    };
    myChart.setOption(option);

}
// function draw() {
//     var myChart = echarts.init(document.getElementById('firstPage-graph1'));
//
//     // 指定图表的配置项和数据
//     var option = {
//         title: {
//             text: '2020上半年杭州夜间打车目的地类型占比',
//             subtext: '数据来源：曹操出行',
//             left: 'center'
//         },
//         tooltip: {
//             trigger: 'item'
//         },
//         // legend: {
//         //     orient: 'vertical',
//         //     left: 'left',
//         // },
//         series: [
//             {
//                 name: '访问来源',
//                 type: 'pie',
//                 radius: '50%',
//                 data: [
//                     {value: 0.4146, name: '商圈:41.46%'},
//                     {value: 0.27, name: '美食街:27%'},
//                     {value: 0.2254, name: '产业园区:22.54%'},
//                     {value: 0.0874, name: '旅游景点:8.74%'},
//                     {value: 0.026, name: '娱乐场所:0.26%'}
//                 ],
//                 emphasis: {
//                     itemStyle: {
//                         shadowBlur: 10,
//                         shadowOffsetX: 0,
//                         shadowColor: 'rgba(0, 0, 0, 0.5)'
//                     }
//                 }
//             }
//         ]
//     };
//     myChart.setOption(option);
//
// }

function draw1(){
    var myChart = echarts.init(document.getElementById('firstPage-graph2'));

    // 指定图表的配置项和数据
    var option = {
        title: {
            text: '2020上半年杭州各行政区夜间出行+消费占比',
            subtext: '数据来源：曹操出行',
            left: 'center'
        },
        tooltip: {
            trigger: 'item'
        },
        // legend: {
        //     orient: 'vertical',
        //     left: 'left',
        // },
        series: [
            {
                // name: '访问来源',
                // type: 'pie',
                // radius: '50%',
                name: '面积模式',
                type: 'pie',
                radius: [20, 80],
                // center: ['25%', '25%'],
                roseType: 'area',
                itemStyle: {
                    borderRadius: 10
                },

                data: [
                    {value: 31.67, name: '西湖区:31.67%'},
                    {value: 12.88, name: '江干区:12.88%'},
                    {value: 12.72, name: '滨江区:12.72%'},
                    {value: 12.3, name: '下城区:12.3%'},
                    {value: 10.41, name: '上城区:10.41%'},
                    {value: 8.31, name: '拱墅区: 8.31%'},
                    {value: 6.94, name: '余杭区:6.94%'},
                    {value: 4.73, name: '萧山区:4.73%'},
                    {value: 0.03, name: '富阳区:0.03%'},
                    {value: 0.01, name: '临安区:0.01%'}
                ],
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 100, 100, 0.5)'
                    }
                }
            }
        ]
    };

myChart.setOption(option);

}

function draw3(){
    var myChart = echarts.init(document.getElementById('firstPage-graph3'));

    // 指定图表的配置项和数据
    var option = {
        title: {
            text: '十一当天全国热门景区排行',
            subtext: '数据来源:飞猪旅行',
            left: 'center'
        },
        dataset: [{
            dimensions: ['name', 'age', 'profession', 'score', 'date'],
            source: [
                [' 杭州西湖 ', 20, 'Teacher', 50, '2011-03-01'],
                [' 上海外滩 ', 20, 'Teacher', 27, '2011-03-01'],
                [' 天安门广场 ', 52, 'Musician', 24, '2011-02-14'],
                [' 广州塔 ', 37, 'Teacher', 11, '2011-02-18'],
                [' 深圳大梅沙海滨公园 ', 25, 'Engineer', 7, '2011-04-02'],
            ]
        }, {
            transform: {
                type: 'sort',
                config: { dimension: 'score', order: 'desc' }
            }
        }],
        xAxis: {
            type: 'category',
            axisLabel: {  rotate: 30 ,interval: 0},
        },
        yAxis: {},
        series: {
            type: 'bar',
            encode: { x: 'score', y: 'name' },
            datasetIndex: 1
        }
    };

myChart.setOption(option);

}
function draw4(){
    var myChart = echarts.init(document.getElementById('firstPage-graph3'));

    // 指定图表的配置项和数据
    option = {
        title: {
            text: '杭州2020年电影票房(百万元)',
            subtext: '数据来源:飞猪旅行',
            left: 'center'
        },
        xAxis: {
            type: 'category',
            data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
            axisLabel: {
                interval: 0,
                rotate: 30
            },
        },
        yAxis: {
            type: 'value'
        },
        series: [{
            // data: [4914.1,0,0,0,0,678.9, 7573, 6349.4, 13956.9, 13956.9, 4535.2,9671.9],
            data: [49.14,0,0,0,0,6.789, 75.73, 63.494, 139.569, 139.569, 45.352,96.719],
            type: 'line'
        },
        {
            name: '最高气温',
            type: 'line',
            data: [100],
            markLine: {
                data: [
                    {type: 'average', name: '平均值'}
                ]
            }
        }]
    };
myChart.setOption(option);

}

